const Router = require('koa-router');
const yamljs = require('yamljs');
const koaSwagger = require('koa2-swagger-ui');
const path = require('path');

const router = new Router();

const spec = yamljs.load(path.resolve(__dirname, './swagger.yaml'));

router.get(
    '/docs',
    koaSwagger({
        routePrefix: false,
        swaggerOptions: {
            spec
        }
    })
);

module.exports = router;
